package com.wiscamp.ninechapters.problems.infrastructure.mappers.sets;

import com.wiscamp.ninechapters.problems.infrastructure.po.sets.ProblemTypeRulePO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Collection;

/**
 * 组题规则-题型规则仓储对象
 *
 * @author yifeng
 */
@Repository
public interface ProblemTypeRuleMapper extends JpaRepository<ProblemTypeRulePO, Long>, JpaSpecificationExecutor<ProblemTypeRulePO> {
    @Query(value = "select e from ProblemTypeRulePO e where e.ruleId = :ruleId")
    Collection<ProblemTypeRulePO> findProblemTypeRules(long ruleId);
}